package gspushmq.model;

import java.util.Date;

import com.alibaba.fastjson.annotation.JSONField;
import gspushmq.util.StringUtil;

public class Data {

	private String uuid;
	/**
	 * 消息标题
	 */
	private String title;
	/**
	 * 信息内容
	 */
	private Object content;
	/**
	 * 附件地址（图片、文件地址）
	 */
	private String fileAddress;
	/**
	 * 附件类型（图片、文件）
	 */
	private String fileType;
	/**
	 * 连接地址
	 */
	private String linkUrl;
	/**
	 * 连接类型（内链、外链）
	 */
	private String linkType;
	/**
	 * 过期时间
	 */
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date expireDate;
	/**
	 * 开始时间
	 */
	@JSONField(format = "yyyy-MM-dd HH:mm:ss")
	private Date startDate;
	/**
	 * 适用群体
	 */
	private String userType;
	/**
	 * 消息类型（api，yjy, sys, hq, live）
	 */
	private String mqType;
	/**
	 * 消息子类型（数据分类）；(api:数据总量，更新数据。yjy：点赞，回复。sys（。。。。），hq（闪电预警），live：（录播，直播，预约）)
	 */
	private String mqSubType;
	
	/**
	 * 产品线
	 */
	private Integer productLine;
	
    /** 模块id*/
    private String module;

    /** 对象id */
    private String target;

    /** 推送方式*/
    private String crowdType;

    /** 推送人群 */
    private String crowdValue;

    /** 来源 */
    private Object source;

	public Data() {}
	//推送时用到
	public Data(Data data){
		this.uuid = data.getUuid();
		// 限制标题字符数量
		this.title = StringUtil.subStringToLength(data.getTitle(),25);
		// 限制内容字符数量
		this.content = StringUtil.subStringToLength( String.valueOf(data.getContent()),110);
		this.fileAddress = data.getFileAddress();
		this.fileType = data.getFileType();
		this.linkUrl = data.getLinkUrl();
		this.linkType = data.getLinkType();
		this.expireDate = data.getExpireDate();
		this.startDate = data.getStartDate();
		this.userType = data.getUserType();
		this.mqType = data.getMqType();
		this.mqSubType = data.getMqSubType();
		this.productLine = data.getProductLine();
		this.module = data.getModule();
		this.target = data.getTarget();
		this.crowdType = data.getCrowdType();
		this.crowdValue = data.getCrowdValue();
	}

	public String getCrowdType() {
		return crowdType;
	}

	public void setCrowdType(String crowdType) {
		this.crowdType = crowdType;
	}

	public String getCrowdValue() {
		return crowdValue;
	}

	public void setCrowdValue(String crowdValue) {
		this.crowdValue = crowdValue;
	}

	public String getModule() {
		return module;
	}
	public String getTarget() {
		return target;
	}
	public void setModule(String module) {
		this.module = module;
	}
	public void setTarget(String target) {
		this.target = target;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Object getContent() {
		return content;
	}
	public void setContent(Object content) {
		this.content = content;
	}
	public String getFileAddress() {
		return fileAddress;
	}
	public void setFileAddress(String fileAddress) {
		this.fileAddress = fileAddress;
	}
	public String getFileType() {
		return fileType;
	}
	public void setFileType(String fileType) {
		this.fileType = fileType;
	}
	public String getLinkUrl() {
		return linkUrl;
	}
	public void setLinkUrl(String linkUrl) {
		this.linkUrl = linkUrl;
	}
	public String getLinkType() {
		return linkType;
	}
	public void setLinkType(String linkType) {
		this.linkType = linkType;
	}
	public Date getExpireDate() {
		return expireDate;
	}
	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public String getMqType() {
		return mqType;
	}
	public void setMqType(String mqType) {
		this.mqType = mqType;
	}
	public String getMqSubType() {
		return mqSubType;
	}
	public void setMqSubType(String mqSubType) {
		this.mqSubType = mqSubType;
	}
	public Integer getProductLine() {
		return productLine;
	}
	public void setProductLine(Integer productLine) {
		this.productLine = productLine;
	}
	public String getUserType() {
		return userType;
	}
	public void setUserType(String userType) {
		this.userType = userType;
	}

	public Object getSource() {
		return source;
	}

	public void setSource(Object source) {
		this.source = source;
	}
}
